package com.example.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.example.contant.MessageConstant;
import com.example.entity.Result;
import com.example.pojo.AddressAdmin;
import com.example.service.AddressAdminService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Member;
import java.util.List;

@RestController
@RequestMapping("/address")
public class AddressController {
    @Reference
    private AddressAdminService addressAdminService;
    @GetMapping("/getall")
    public Result getAll(){
        try{
            List<AddressAdmin> list=addressAdminService.findAll();
            return new Result(true,MessageConstant.GET_ADDRESADMIN_SUCCESS,list);
        }catch (Exception e){
            e.printStackTrace();
            return new Result(false, MessageConstant.GET_ADDRESADMIN_FAIL);
        }


    }
}
